import java.util.ArrayList;
import java.util.Arrays;

public class ArrayListText {
    public static void main(String[] args) {
        ArrayList<Integer> arrayList=new ArrayList<>();
        //依次尾插54321
        for (int i = 5; i>0 ; i--) {
            arrayList.add(i);
        }
        System.out.println(arrayList.toString());
        //指定位置插入,下标为三处插入元素0
        arrayList.add(3,0);
        System.out.println(arrayList.toString());//删除该下标的元素
        arrayList.remove(3);
        System.out.println(arrayList.toString());
        System.out.println(arrayList.get(0));
        arrayList.clear();
        System.out.println(arrayList.toString());
    }
}
